Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

feat: add support for python 3.10#131

Merged
parthea merged 2 commits intomainfrom
add-python-310
Oct 14, 2021
Merged

feat: add support for python 3.10#131
parthea merged 2 commits intomainfrom
add-python-310

Conversation

@parthea
Copy link
Copy Markdown
Contributor

@parthea parthea commented Oct 14, 2021

This PR pulls in the latest synthtool templates and adds python 3.10 samples testing.

@parthea parthea requested a review from m-strzelczyk as a code owner October 14, 2021 13:19
@parthea parthea requested a review from a team October 14, 2021 13:19
@parthea parthea requested a review from a team as a code owner October 14, 2021 13:19
@parthea parthea requested review from a team and nicain October 14, 2021 13:19
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 14, 2021
@product-auto-label product-auto-label bot added the api: compute Issues related to the googleapis/python-compute API. label Oct 14, 2021
@parthea parthea added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Oct 14, 2021
@parthea
Copy link
Copy Markdown
Contributor Author

parthea commented Oct 14, 2021

Wait for python 3.10 samples to pass

# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "python-docs-samples-tests-310"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is breaking naming convention. It should be python-docs-samples-tests-py310.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regretfully, the string python-docs-samples-tests-py310 is 31 characters long which exceeds the Project ID requirement Must be 6 to 30 characters in length defined here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Well, then there's nothing we can do I guess. In a couple of years, when Python 3.9 is deprecated, we'll be consistent once again 😆

@parthea parthea added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Oct 14, 2021
@yoshi-kokoro yoshi-kokoro removed kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Oct 14, 2021
@parthea
Copy link
Copy Markdown
Contributor Author

parthea commented Oct 14, 2021

I'm going to try running the python 3.10 tests again to see if it fails again. See build log here.

=================================== FAILURES ===================================
_____________________ test_set_usage_export_bucket_default _____________________

capsys = <_pytest.capture.CaptureFixture object at 0x7f7b25eadf30>
temp_bucket = <Bucket: test93423d36ae>

    def test_set_usage_export_bucket_default(capsys: typing.Any,
                                             temp_bucket: storage.Bucket) -> None:
        set_usage_export_bucket(project_id=PROJECT, bucket_name=temp_bucket.name)
        time.sleep(5)  # To make sure the settings are properly updated
        uel = get_usage_export_bucket(project_id=PROJECT)
        assert(uel.bucket_name == temp_bucket.name)
        assert(uel.report_name_prefix == 'usage_gce')
        out, _ = capsys.readouterr()
        assert('default prefix of `usage_gce`.' in out)
    
        disable_usage_export(project_id=PROJECT)
        time.sleep(5)  # To make sure the settings are properly updated
        uel = get_usage_export_bucket(project_id=PROJECT)
>       assert(uel.bucket_name == '')
E       AssertionError: assert 'testeb98c2a4c2' == ''
E         + testeb98c2a4c2

test_sample_default_values.py:51: AssertionError
----------------------------- Captured stdout call -----------------------------
Report name prefix not set, replacing with default value of `usage_gce`.
_____________________ test_set_usage_export_bucket_custom ______________________

capsys = <_pytest.capture.CaptureFixture object at 0x7f7b25d640a0>
temp_bucket = <Bucket: test93423d36ae>

    def test_set_usage_export_bucket_custom(capsys: typing.Any,
                                            temp_bucket: storage.Bucket) -> None:
        set_usage_export_bucket(project_id=PROJECT, bucket_name=temp_bucket.name,
                                report_name_prefix=TEST_PREFIX)
        time.sleep(5)  # To make sure the settings are properly updated
        uel = get_usage_export_bucket(project_id=PROJECT)
>       assert(uel.bucket_name == temp_bucket.name)
E       AssertionError: assert 'teste489dd6266' == 'test93423d36ae'
E         - test93423d36ae
E         + teste489dd6266

test_sample_default_values.py:61: AssertionError
=============================== warnings summary ===============================
../../google/cloud/compute_v1/services/accelerator_types/client.py:17
  /workspace/google/cloud/compute_v1/services/accelerator_types/client.py:17: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
    from distutils import util

-- Docs: https://docs.pytest.org/en/stable/warnings.html
-------- generated xml file: /workspace/samples/snippets/sponge_log.xml --------
=========================== short test summary info ============================
FAILED test_sample_default_values.py::test_set_usage_export_bucket_default - ...
FAILED test_sample_default_values.py::test_set_usage_export_bucket_custom - A...
============== 2 failed, 7 passed, 1 warning in 801.38s (0:13:21) ==============

@m-strzelczyk
Copy link
Copy Markdown
Contributor

@parthea are you running with different project per different version? Those tests require the 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', config set, or they're racing each other.

@parthea
Copy link
Copy Markdown
Contributor Author

parthea commented Oct 14, 2021

I have BUILD_SPECIFIC_GCLOUD_PROJECT set here and the noxfile_config.py file looks good.

The python 3.10 samples test is passing now so we're good to go.

@parthea parthea removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Oct 14, 2021
@parthea parthea requested a review from m-strzelczyk October 14, 2021 14:35
@parthea parthea added do not merge Indicates a pull request not ready for merge, due to either quality or timing. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Oct 14, 2021
@parthea
Copy link
Copy Markdown
Contributor Author

parthea commented Oct 14, 2021

@m-strzelczyk Please could you review/approve?

@parthea parthea merged commit 703ac17 into main Oct 14, 2021
@parthea parthea deleted the add-python-310 branch October 14, 2021 16:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: compute Issues related to the googleapis/python-compute API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants